package com.xunqi.mall.service;

import com.xunqi.mall.form.CartAddForm;
import com.xunqi.mall.form.CartUpdateForm;
import com.xunqi.mall.pojo.Cart;
import com.xunqi.mall.vo.CartVo;
import com.xunqi.mall.vo.ResponseVo;

import java.util.List;

/**
 * @Description:
 * @Created with IntelliJ IDEA.
 * @author: 夏沫止水
 * @create: 2020-04-24 09:52
 **/
public interface CartService {

    /**
     * 添加商品到购物车
     * @param uid
     * @param form
     * @return
     */
    ResponseVo<CartVo> addCart(Integer uid, CartAddForm form);


    /**
     * 购物车列表
     * @param uid
     * @return
     */
    ResponseVo<CartVo> cartList(Integer uid);


    /**
     * 更新购物车信息
     * @param uid
     * @param productId
     * @param form
     * @return
     */
    ResponseVo<CartVo> updateCart(Integer uid, Integer productId, CartUpdateForm form);


    /**
     * 删除购物车某个商品的信息
     * @param uid
     * @param productId
     * @return
     */
    ResponseVo<CartVo> deleteCart(Integer uid,Integer productId);


    /**
     * 全选中商品
     * @param uid
     * @return
     */
    ResponseVo<CartVo> selectAll(Integer uid);

    /**
     * 全不选中商品
     * @param uid
     * @return
     */
    ResponseVo<CartVo> unSelectAll(Integer uid);

    /**
     * 查询购物车信息
     * @param uid
     * @return
     */
    List<Cart> listForCart(Integer uid);


    /**
     * 获取购物中所有商品数量总和
     * @param uid
     * @return
     */
    ResponseVo sumCart(Integer uid);
}
